package com.sz.android;

public class Test {
    public static void main(String[] args) {

        Looper.prepare();

        Handler handler = new Handler(){
            @Override
            public void handleMessage(Message message) {
                super.handleMessage(message);
                System.out.println("Test.handleMessage "+message+"----------"+Thread.currentThread().getName());
            }
        };

        Thread thread = new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    Thread.sleep(5000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                System.out.println("Test.run XXX "+Thread.currentThread().getName());
                Message message = new Message("msg from thread");
                handler.sendMessage(message);
            }
        });

        thread.start();

        Looper.loop();





    }
}
